﻿using MCPlatform.MotionLib.Base.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace MCPlatform.MotionLib.Base
{
    public interface IIO
    {
        #region Properties

       

        /// <summary>
        /// IO名称
        /// </summary>
        public string IOName { get ; set ; }
      

        /// <summary>
        /// IO类型，输入或者输出
        /// </summary>
        public string Type { get; set; }
       

        /// <summary>
        /// IO地址
        /// </summary>
        public ushort Address { get; set; }


        /// <summary>
        /// IO值
        /// </summary>
        public bool Value { get; set; }


        public bool Flipper { get; set; }


        public bool IsShield { get; set; }


        public int DelayTime { get; set; }

        public IOParaModel IOConfig { get; set; }


        #endregion


        public event Action<object>? RisingEvent;
        public event Action<object>? FallingEvent;



        public short ReadInBit(ushort bitNo);

        public short ReadOutBit(ushort bitNo);

        public short WriteOutBit(ushort bitNo, ushort onOrOff);

        public short WriteOutBitNolog(ushort bitNo, ushort onOrOff);
    }
}
